#ifndef SDK_OHOS_OHOS_SCREEN_CAPTURER_WRAP_H
#define SDK_OHOS_OHOS_SCREEN_CAPTURER_WRAP_H
#include <memory>
#include "ohos_screen_capturer.h"
#include "api/peer_connection_interface.h"

namespace webrtc {

class ScreenCapturerOhosWrap : public ScreenCallback {
public:
    ScreenCapturerOhosWrap(PeerConnectionFactoryInterface* pc_factory, rtc::Thread *worker_thread);
    ~ScreenCapturerOhosWrap();
    int DidCaptureVideoFrame(const webrtc::VideoFrame& frame, int capture_width, int capture_height) override;
    void OnCaptureError(int32_t error_code) override;
    bool Init();
    bool Start(const cricket::VideoFormat& capture_format);
    void Stop();
    void RegisterCaptureDataCallback(rtc::VideoSinkInterface<webrtc::VideoFrame>* callback);
    void SetFrameRotation(int rotation);
private:
    std::unique_ptr<ScreenCapturerOhos> screen_capture_;
    PeerConnectionFactoryInterface* pc_factory_;
    std::unique_ptr<ohoswebrtc::OHOSExternalAudioSourceImpl> external_audio_source_;
    rtc::VideoSinkInterface<webrtc::VideoFrame> *dataCallback_;
    rtc::Thread* worker_thread_ = nullptr;
    int width_;
    int height_;
};
}

#endif
